package com.common.repository.judicialcheck;

import com.common.entity.judicialcheck.JudicialCheckEntity;
import com.common.entity.target.TargetItemAssignEntity;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author johnny
 * @create 2021-05-13 10:24 下午
 **/
public interface JudicialCheckRepository extends JpaRepository<JudicialCheckEntity, Long> {


    void deleteByPersonalIdAndYearAndMonth(Long personalId, Integer year, Integer month);

    Long deleteByPersonalIdAndYearAndMonthAndTargetItemId(Long personalId, Integer year, Integer month, Long targetItemId);

    Long countByPersonalIdAndYearAndMonthAndTargetItemId(Long personalId, Integer year, Integer month, Long targetItemId);

    Long countByPersonalIdAndYearAndMonth(Long personalId, Integer year, Integer month);


    List<JudicialCheckEntity> findByPersonalIdAndTargetSuperTypeIdAndYearAndMonth(Long personalId,
                                                                                  Long targetSuperId,
                                                                                  Integer year,
                                                                                  Integer month);
}